import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'index',
    redirect: '/insure',
    meta: {
      title: '宜春惠民保',
    },
  },
  {
    path: '/insure',
    name: 'insure',
    component: () => import("@/views/insure/insure"),
    meta: {
      title: '宜春惠民保',
    },
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.afterEach((to: any, form: any) => {
  document.title = to.meta?.title || '';
})

export default router;